Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Set default for _imageAlignment for popup images (fixes #149) #150

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

kirsty-hames
Copy link
Contributor

Fixes #149

Fix

  • Provide a default display of _imageAlignment: "right" in the instance _imageAlignment isn't set. The schemas already define a default value of right.

Testing

  1. In component.json, include a Hotgrid instance containing items with _imageAlignment left, right and blank values. For example:
   {
    "_id": "c-130",
    "_parentId": "b-120",
    "_type": "component",
    "_component": "hotgrid",
    "_classes": "",
    "_layout": "full",
    "title": "Hotgrid",
    "displayTitle": "Hotgrid",
    "body": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.",
    "instruction": "Select the images to find out more.",
    "_comment": "setCompletionOn = inview | allItems",
    "_setCompletionOn": "allItems",
    "_canCycleThroughPagination": false,
    "_hidePagination": false,
    "_columns": 3,
    "_isRound": false,
    "_showPlusIcon": false,
    "_items": [
        {
            "title": "Item Title 1",
            "body": "This is display text 1. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.",
            "_imageAlignment": "right",
            "_comment": "Supported classes = 'hide-desktop-image' | 'hide-popup-image'. Additional classes can be used but they must be predefined in one of the Less files",
            "_classes": "",
            "_graphic": {
                "src": "course/en/images/menu-item.png",
                "srcHover": "",
                "srcVisited": "",
                "alt": "",
                "title": "Grid Title 1",
                "_classes": ""
            },
            "_itemGraphic": {
                "src": "course/en/images/menu-item.png",
                "alt": "",
                "attribution": "Copyright © 2019"
            }
        },
        {
            "title": "Item Title 2",
            "body": "This is display text 2 with a left aligned image.",
            "_imageAlignment": "left",
            "_classes": "",
            "_graphic": {
                "src": "course/en/images/menu-item.png",
                "srcHover": "",
                "srcVisited": "",
                "alt": "",
                "title": "Grid Title 2",
                "_classes": ""
            },
            "_itemGraphic": {
                "src": "course/en/images/menu-item.png",
                "alt": "",
                "attribution": ""
            }
        },
        {
            "title": "Item Title 3",
            "body": "This is display text 3.",
            "_imageAlignment": "",
            "_classes": "",
            "_graphic": {
                "src": "course/en/images/menu-item.png",
                "srcHover": "",
                "srcVisited": "",
                "alt": "",
                "title": "Grid Title 3",
                "_classes": ""
            },
            "_itemGraphic": {
                "src": "course/en/images/menu-item.png",
                "alt": "",
                "attribution": ""
            }
        }
    ],
    "_pageLevelProgress": {
        "_isEnabled": true
    }
  },
  1. Review the Hotgrid in your course and ensure the item popup display matches the _imageAlignment value set. The blank value should default to right aligned display.

@kirsty-hames kirsty-hames requested a review from swashbuck April 24, 2024 13:59
@kirsty-hames kirsty-hames self-assigned this Apr 24, 2024
@kirsty-hames
Copy link
Contributor Author

I'll wait for the Hotgraphic PR reviews before merging incase this requires any updates for consistency.

Copy link
Contributor

@swashbuck swashbuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kirsty-hames kirsty-hames merged commit ccaee3f into master Apr 29, 2024
1 check passed
@kirsty-hames kirsty-hames deleted the issue/149 branch April 29, 2024 08:25
github-actions bot pushed a commit that referenced this pull request Apr 29, 2024
## [4.5.3](v4.5.2...v4.5.3) (2024-04-29)

### Fix

* Set default for _imageAlignment for popup images (fixes #149) (#150) ([ccaee3f](ccaee3f)), closes [#149](#149) [#150](#150)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set default for _imageAlignment for popup images
3 participants